fix(github): add persist-credentials: false to workflow templates #8202
+20
−10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Adds
persist-credentials: falseto allactions/checkout@v6steps in workflow templates to prevent the "Duplicate Authorization header" error.Problem
When using
actions/checkout@v6with the OpenCode GitHub action, users encounter:Root Cause
actions/checkout@v6persists the GitHub token to git config viahttp.extraheaderanomalyco/opencode/github@latestaction adds its own authenticationSolution
Add
persist-credentials: falseto the checkout step in all workflow templates:This prevents the checkout action from persisting credentials, allowing the OpenCode action to handle authentication without conflicts.
Changes
packages/opencode/src/cli/cmd/github.ts- CLI-generated workflow templatepackages/web/src/content/docs/github.mdx- Documentation examples (4 workflows)github/README.md- Manual setup exampleRelated Issues
actions/checkout@v6#6969 - "docs: update GHA examples to use actions/checkout@v6" (merged, but didn't add persist-credentials)Testing
Users experiencing the error can update their workflows to include
persist-credentials: falsein the checkout step. New users following the setup instructions will get the correct configuration automatically.